﻿@page "/basket"
@using MASA.EShop.Web.Client.Data.Basket.Record
@inherits EShopBasePage

<PageTitle>Basket</PageTitle>

<MContainer>
    <MTable TItem="BasketItem" Headers="_headers" Loading="_loading" Items="_userBasket.Items">
        <MTableCol Width="150">
            <img src="@context.PictureUrl" height="100" width="150" />
        </MTableCol>
        <MTableCol>
            @context.ProductName
        </MTableCol>
        <MTableCol>
            @context.UnitPrice
        </MTableCol>
        <MTableCol>
            @*todo 可编辑*@
            @context.Quantity
        </MTableCol>
        <MTableCol>
            @context.GetFormattedTotalPrice()
        </MTableCol>
    </MTable>
    <MRow>
        <div class="float-right mr-10">
        <span>$</span>@_userBasket.GetFormattedTotalPrice()
@*    https://codepen.io/jairoerazo/pen/wvzYBVW*@
    </div>
    </MRow>
    <MRow>
        <MCol Md="3">
            <MButton Tile Color="success" OnClick='()=>Navigation("catalog")'>
                CONTINUE SHOPPING
            </MButton>
        </MCol>
        <MSpacer></MSpacer>
        <MCol Md="1">
            <MButton Tile Color="success" Disabled>
                UPDATE
            </MButton>
        </MCol>
        <MCol Md="1">
            <MButton Tile Color="success" OnClick='()=>Navigation("basket/checkout")'>
                CHECKOUT
            </MButton>
        </MCol>
    </MRow>
</MContainer>